﻿@model GoDive.App.DestViewModel

@{
    ViewBag.Title = "潜啊：一个专做潜水的自由社区";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section footer{
    <script src="@Url.Content("/webresource/js/destcomments.js")"></script>
}
@{
    object destID = ViewContext.RouteData.Values["id"];
}
@Html.Partial("~/Views/Dest/detailShared.cshtml")
<div class="plcMenuBarHolder" id="tabs">
    <div class="plcMenuBars">
        <div class="plcMenuBar countryBar">
            <ul class="plcMenuBarList fontYaHei">
                <li class="jieshao"><a href="/dest/detail/@destID"><i class="icon"></i>潜点介绍</a></li>
                <li class="daoda"><a href="/dest/traffic/@destID"><i class="icon"></i>到达方式</a></li>
                <li class="gonglve"><a href="/dest/article/@destID"><i class="icon"></i>潜水攻略</a></li>
                <li class="dianping current"><a href="/dest/comment/@destID"><i class="icon"></i>点评</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="qd-wrap" id="comments">
    <div class="qd gl dp">
        <div class="title">
            <h2>点评</h2>
        </div>
        <ul class="articles-group articles">
            @{
                foreach (var item in Model.DestinationComments.Rows)
                {
                    <li class="articles-item">
                        <div class="auth">
                            <a class="author" href="">
                                <img src="http://120.24.102.165@{@item.User.AvatarMiddle}" class="img-circle" alt="">
                            </a>
                        </div>
                        <div class="texts">
                            <div class="title-wrap">
                                <a href="" class="title-small">@item.User.UserName</a>
                                <span class="num-wrap">
                                    <span class="num pull-left">
                                        @for (int i = 0; i < item.Score; i++)
                                        {
                                            <i class="icon icon-star"></i>
                                        }
                                    </span>
                                    <span class="num zan"><i class="icon icon-zan"></i><span>@item.PariseCount</span></span>
                                </span>
                            </div>
                            <div class="content-wrap">
                                <p class="content">@item.Content</p>
                            </div>
                            <div class="pics">
                                @{
                    if (!string.IsNullOrEmpty(@item.Pic1))
                    {
                        <img src="http://120.24.102.165@{@item.Pic1}" alt="">
                    }
                    if (!string.IsNullOrEmpty(@item.Pic2))
                    {
                        <img src="http://120.24.102.165@{@item.Pic2}" alt="">
                    }
                    if (!string.IsNullOrEmpty(@item.Pic3))
                    {
                        <img src="http://120.24.102.165@{@item.Pic3}" alt="">
                    }
                    if (!string.IsNullOrEmpty(@item.Pic4))
                    {
                        <img src="http://120.24.102.165@{@item.Pic4}" alt="">
                    }
                    if (!string.IsNullOrEmpty(@item.Pic5))
                    {
                        <img src="http://120.24.102.165@{@item.Pic5}" alt="">
                    }
                                }
                            </div>
                            <span class="title-by">@item.DataChangeTime.ToShortDateString()</span>
                        </div>
                    </li>
                }
            }
        </ul>
        @if (Model.DestinationComments.PageTotalCount > 1)
        {
            <nav>
                <ul class="pagination pull-right">
                    @if (@Model.DestinationComments.HasPrevPage)
                    {
                        <li class="active"><a href="#" aria-label="Previous">上一页</a></li>
                    }

                    @{
            for (int i = 1; i <= Model.DestinationComments.PageTotalCount; i++)
            {
                string className = i == Model.DestinationComments.PageIndex ? "active" : string.Empty;
                <li class="@className" data-page="@i"><a>@i</a></li>
            }
                    }
                    @if (@Model.DestinationComments.HasNextPage)
                    {
                        <li><a>下一页</a></li>
                    }
                </ul>
            </nav>
        }
    </div>
</div>
<script type="text/template" id="article-template">
    <%_.each(articles, function(item) {%>
        <li class="articles-item">
            <div class="auth">
                <a class="author" href="">
                    <img src="http://120.24.102.165<%=item.User.AvatarMiddle%>" class="img-circle" alt="">
                </a>
            </div>
            <div class="texts">
                <div class="title-wrap">
                    <a href="" class="title-small"><%=item.User.UserName%></a>
                    <span class="num-wrap">
                        <span class="num pull-left">
                            <%_.each(item.Score, function() { %>
                                <i class="icon icon-star"></i>
                            <%})%>
                        </span>
                        <span class="num zan"><i class="icon icon-zan"></i><span><%=item.PariseCount%></span></span>
                    </span>
                </div>
                <div class="content-wrap">
                    <p class="content"><%=item.Content%></p>
                </div>
                <div class="pics">
                    <%if(item.Pic1) {%>
                    <img src="http://120.24.102.165<%=item.Pic1%>" alt="">
                    <%}%>
                    <%if(item.Pic2) {%>
                    <img src="http://120.24.102.165<%=item.Pic2%>" alt="">
                    <%}%>
                    <%if(item.Pic3) {%>
                    <img src="http://120.24.102.165<%=item.Pic3%>" alt="">
                    <%}%>
                    <%if(item.Pic4) {%>
                    <img src="http://120.24.102.165<%=item.Pic4%>" alt="">
                    <%}%>
                    <%if(item.Pic5) {%>
                    <img src="http://120.24.102.165<%=item.Pic5%>" alt="">
                    <%}%>
                </div>
                <span class="title-by"><%=item.DataChangeTime%></span>
            </div>
        </li>
    <%})%>
</script>